var vm;
var windowWidth;
var txtlength;
function rollInit(target, text = '') {
  if(vm){
    return;
  }
  windowWidth = wx.getSystemInfoSync().windowWidth;
  txtlength = text.length * 13;
  vm = target;
  vm.setData({
    text: text,
    winWidth: windowWidth,
    txtlen: txtlength,
    pmdAmt:''
  });
}

function showNoticePanel() {
  this.setData({
    noticeIsShow: true
  });
}

function closeNoticePanel() {
  this.setData({
    noticeIsShow: false
  });
}

// var pmd_amt = wx.createAnimation({
//   duration: 20000,
//   timingFunction: "linear",
//   delay: 0,
//   transformOrigin: "50% 50%",
// });

function run3(){
  // console.log('amt------------------');
  // var amtVal = -vm.data.txtlen;
  // console.log(amtVal)
  // pmd_amt.translateX(-100).step();
  // vm.setData({
  //   pmdAmt: pmd_amt.export()
  // });
}

function stopRun3(){

}

module.exports = {
  rollInit: rollInit,
  run1: run3,
  stopRun1: stopRun3,
  showNotice: showNoticePanel,
  closeNotice: closeNoticePanel
}